package com.hc.fdkgoods.dao;

import com.hc.fdkgoods.vo.ForwarderSupplierVO;
import org.springframework.stereotype.Repository;

import java.util.List;

import static com.hc.fdkgoods.db.tables.SellerOnPrepareSkuList.SELLER_ON_PREPARE_SKU_LIST;
import static com.hc.fdkgoods.db.tables.ForwarderSupplier.FORWARDER_SUPPLIER;

@Repository
public class PushedBizSummaryDao extends BaseDao{
    public List<ForwarderSupplierVO> queryPushedBiz(){
        return  db.select(
                FORWARDER_SUPPLIER.BUSINESS, FORWARDER_SUPPLIER.CITY, FORWARDER_SUPPLIER.CITY_CODE,
                FORWARDER_SUPPLIER.FLOOR, FORWARDER_SUPPLIER.FLOOR_CODE, FORWARDER_SUPPLIER.FORWARDER_SUPPLIER_ID,
                FORWARDER_SUPPLIER.GROUP_NAME, FORWARDER_SUPPLIER.MARKET, FORWARDER_SUPPLIER.MARKET_CODE,
                FORWARDER_SUPPLIER.SUPPLIER_NAME
        )
                .from(FORWARDER_SUPPLIER)
                .innerJoin(SELLER_ON_PREPARE_SKU_LIST)
                .on(SELLER_ON_PREPARE_SKU_LIST.SUPPLIER_ID.eq(FORWARDER_SUPPLIER.FORWARDER_SUPPLIER_ID))
                .fetchInto(ForwarderSupplierVO.class);
    }
}
